import "babel-polyfill";
import Deque from "./deque";

export default class DoubleEndedQueue {
    data = new Deque();

    constructor() {
        this.push(...arguments);
    }

    get [Symbol.toStringTag]() {
        return "DEQueue";
    }

    get length() {
        return this.data.length;
    }

    pushFront() {
        return this.data.unshift(...arguments);
    }
    popFront() {
        return this.data.shift();
    }
    front() {
        return this.data.get(0);
    }
    pushBack() {
        return this.data.push(...arguments);
    }
    popBack() {
        return this.data.pop();
    }
    back() {
        return this.data.get(this.length - 1);
    }
};
